



<html>

<head>
<LINK href="Style.css" rel=stylesheet> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
<title>Quan ly sinh vien</title>
</head>

<body>
  <div id ="mainWap">
  
     <div id ="header">
     <div id ="titlelabel">STUDENT MANAGER</div>
      <ul id="menu">
         <li><a href="index.php">HOME PAGE</a></li>
         <li><a href="insert.php">INSERT</a></li>
         <li><a href="edit.php">EDIT</a></li>
         <li><a href="delete.php">DELETE</a></li>
      </ul>
     </div>
     <div class="clear"></div>
     <div id ="left">
     </div>
     <div id="right">
     
     

<?php      
     
     $user = "root";
$password = "";
$database = "SinhVienDatabase";
mysql_connect("localhost",$user,$password);
mysql_query("set names 'utf8'");
mysql_select_db($database) or die( "Unable to select database");

$query = "Select * from sinhvien";
$result = mysql_query($query);
$number = mysql_num_rows($result);
//echo "<br> So luong ket qua ".$number;


while ($index < $number) {
	$mssv = mysql_result($result, $index,"mssv");
	$hoten = mysql_result($result, $index,"hoten");
	$gioitinh = mysql_result($result, $index,"gioitinh");
	$gender;
	if ($gioitinh=="0"){
		$gender = "Nữ";
	}
	else{
		$gender = "Nam";
	}
	$ngaysinh = mysql_result($result, $index,"ngaysinh");
	$quequan = mysql_result($result, $index,"quequan");
	$nganhhoc = mysql_result($result, $index,"nganhhoc");
	//echo "<br>Shsv:$mssv Hoten:$hoten Ngaysinh: $ngaysinh Quequan: $quequan Nganhhoc: $nganhhoc";
	

	echo"<div class= 'block'>
	<a href='#'>Mã số: $mssv </a>
	<img src='http://www.arayaclean.com/images/default-avatar.png' alt='$hoten' >
	<p>Họ tên: $hoten </p>
	<p>Giới tính: $gender </p>
	<p>Ngày sinh: $ngaysinh</p>
	<p>Quê quán: $quequan</p>
	<p>Ngành học: $nganhhoc</p>
	</div>
	";


	$index++;
}
?>


     </div>
  </div>
</body>



</html>
